package com.zrrd.mcl.webll.controller;

import com.zrrd.mcl.common.result.Result;
import com.zrrd.mcl.product.client.ProductFeiginClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IndexController {

    @Autowired
    private ProductFeiginClient productFeiginClient;

    @GetMapping({"/", "index.html"})
    public String index(HttpServletRequest request) {
        Result result = productFeiginClient.getBaseCategoryList();
        request.setAttribute("list", result.getData());
        return "index/index";
    }


}
